import request from '@/utils/request'

export function getList(data) {
  return request({
    url: '/erp/strategy/list',
    method: 'get',
    params: data,
  })
}

export function getAllList() {
  return request({
    url: '/erp/strategy/all',
    method: 'get',
  })
}

export function getApprovedList() {
  return request({
    url: '/erp/strategy/all',
    method: 'get',
    params: { approved: true },
  })
}

export function doAdd(data) {
  return request({
    url: '/erp/strategy/add',
    method: 'post',
    data,
  })
}

export function doCopy(data) {
  return request({
    url: '/erp/strategy/copy',
    method: 'post',
    data,
  })
}

export function doEdit(data) {
  return request({
    url: '/erp/strategy/',
    method: 'put',
    data,
  })
}

export function doDelete(data) {
  return request({
    url: '/erp/strategy/' + data,
    method: 'delete',
  })
}

export function doGetStrategyDetail(data) {
  return request({
    url: '/erp/strategy/detail/' + data,
    method: 'get',
  })
}

export function doGetStrategyItems(data) {
  return request({
    url: '/erp/strategy/' + data,
    method: 'get',
  })
}

export function doApproved(data) {
  return request({
    url: '/erp/strategy/approved/' + data,
    method: 'post',
  })
}

export function doUpdateCategoryCode() {
  return request({
    url: '/erp/strategy/updateCategory/',
    method: 'put',
  })
}

export function doMultiSetPriceStrategy(data) {
  return request({
    url: '/erp/strategy/updateMultiPriceStrategy/',
    method: 'put',
    data,
  })
}

export function doMultiSetMoqStrategy(data) {
  return request({
    url: '/erp/strategy/updateMultiMoqStrategy/',
    method: 'put',
    data,
  })
}

export function doMultiSetStopSellStrategy(data) {
  return request({
    url: '/erp/strategy/updateMultiStopSellStrategy/',
    method: 'put',
    data,
  })
}
